<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>字符串学习</title>
    <script>
        //      ``引号中的内容保存格式
        let string1 = `尊敬的旅客您好：
                            很抱歉的通知您，您的航班已经延误。请
                                                20240417
                                                天使航空组
                                    `
        console.log(string1)

        // 要输出的字符串为：`He said : 'OK, "I will go now"`
        let string2 = `\`He said : 'OK, "I will go now"\``
        // 要输入的内容：He said : 'OK, "I will go now"
        let string3 = "He said : 'OK, \"I will go now\" "
        let string4 = 'He said : \'OK, "I will go now"'
        //总结：如果要输出的字符串占用了'  "   ` ,就用\来把要输出的占用的转义一下
        console.log(string2)
        console.log(string3)
        console.log(string4)

        console.log("========================")

        str1 = [2,3,4,5]
        str2 = '我要输出：'
        str3 = str1 + str2
        console.log(str3)
        console.log(typeof(str3))

        stri1  = 'cHl0aG9uMy52aXAlMjAlRTclOTklQkQlRTYlOUMlODglRTklQkIlOTElRTclQkUlQkQlMjAlRTclODklODglRTYlOUQlODMlRTYlODklODAlRTYlOUMlODk='
        console.log(stri1.length)
        console.log(stri1[stri1.length-1])
        //下面两种写法没有，跟python不一样
        console.log(stri1[-2])
        console.log(stri1[0,2])

    </script>
</head>
<body>
20240417号字符串

</body>


</html>